﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/SiteAdmin.Master"
    CodeBehind="EntidadesListado.aspx.cs" Inherits="WebApplication1.Admin.EntidadesListado" %>

<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


<script language="javascript">
    function confirmEditAspx() {
        var counter = ASPxGridViewEntidades.GetSelectedRowCount();

        if (counter > 1) {
            counter = 0;
            alert("Debe seleccionar un solo registro");
            return (false);
        }
        else if (counter == 1) {
            counter = 0;
            return (true);
        }
        else if (counter == 0) {
            counter = 0;
            alert("Debe seleccionar al  menos un registro");
            return (false);
        }
    }
				
    </script>
    <table style="width: 100%;">
        <tr>
            <td colspan="2">
                <table>
                    <tr>
                        <td>
                            <dx:ASPxButton ID="btnNuevo" runat="server" Text="NUEVO" Theme="SoftOrange" 
                                onclick="btnNuevo_Click">
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnActualizar" runat="server" Text="MODIFICAR" Theme="SoftOrange" 
                                onclick="btnActualizar_Click">
                                <ClientSideEvents Click="function(s, e) {return confirmEditAspx();}" />
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnEliminar" runat="server" Text="ELIMINAR" 
                                Theme="SoftOrange">
                                <ClientSideEvents Click="function(s, e) {return confirmEditAspx();}" />
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnPublicar" runat="server" Text="PUBLICAR" 
                                Theme="SoftOrange" onclick="btnPublicar_Click">
                                <ClientSideEvents Click="function(s, e) { Callback.PerformCallback();  LoadingPanel.Show(); }" />
                            </dx:ASPxButton>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <dx:ASPxGridView ID="ASPxGridViewEntidades" runat="server" AutoGenerateColumns="False" ClientInstanceName="ASPxGridViewEntidades"
                    ClientIDMode="AutoID" KeyFieldName="ENT_ID" Width="100%" 
                    Theme="Office2003Silver">
                    <Columns>
                        <%--<dx:GridViewDataTextColumn Caption="Entidad" FieldName="ENT_NOMBRE" 
                                                            ShowInCustomizationForm="True" VisibleIndex="0">
                                                            <CellStyle BackColor="#E3CEFF">
                                                                <Border BorderColor="Silver" />
                                                            </CellStyle>
                                                        </dx:GridViewDataTextColumn>--%>
                        <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                        </dx:GridViewCommandColumn>
                        <dx:GridViewDataTextColumn Caption="Nombre" FieldName="ENT_NOMBRE"
                            VisibleIndex="2">
                            <CellStyle>
                                <Border BorderColor="Silver" />
                                <Border BorderColor="Silver"></Border>
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Dirección" FieldName="ENT_DIRECCION"
                            VisibleIndex="3">
                            <CellStyle>
                                <Border BorderColor="Silver" />
                                <Border BorderColor="Silver"></Border>
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Departamento" FieldName="DEPARTAMENTO"
                            VisibleIndex="4">
                            <CellStyle BackColor="#E3CEFF">
                                <Border BorderColor="Silver" />
                                <Border BorderColor="Silver"></Border>
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Municipio" FieldName="MUNICIPIO"
                            VisibleIndex="5">
                            <CellStyle>
                                <Border BorderColor="Silver" />
                                <Border BorderColor="Silver"></Border>
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Tipo Entidad" FieldName="TEA_DESCRIPCION" 
                            VisibleIndex="6">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="ENT_ID" VisibleIndex="1" Caption="Id">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Clase Entidad" FieldName="ACE_NOMBRE" 
                            VisibleIndex="7">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Estado" FieldName="ENT_ESTADO" 
                            VisibleIndex="8">
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <Settings ShowFilterRow="True" />
                    <Settings ShowFilterRow="True"></Settings>
                </dx:ASPxGridView>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>

</asp:Content>
